package ltd.entity;

import com.fasterxml.jackson.annotation.JsonTypeInfo;

import javax.persistence.*;
//JPA提供的四种标准用法为TABLE,SEQUENCE,IDENTITY,AUTO. 
//TABLE：使用一个特定的数据库表格来保存主键。 
//SEQUENCE：根据底层数据库的序列来生成主键，条件是数据库支持序列。 
//IDENTITY：主键由数据库自动生成（主要是自动增长型） 
//AUTO：主键由程序控制。 


@Entity
@JsonTypeInfo(use= JsonTypeInfo.Id.MINIMAL_CLASS, include = JsonTypeInfo.As.PROPERTY)
public class Layout {
    private Integer id;                 //自增，主键
    private Integer type;				//非自增，非主键
    private Integer ext;
    private Integer top;
    private Integer h;
    private Integer w;
    private Integer device;
    private Integer page;
    private Integer x;
    private Integer y;
    private Integer mode;
    private String name;
    private String src;
    private String packagename;
    private String subject0;
    private String subject1;
    private String time;
    private String size;
    private Integer ver;
    private Integer control;
	public Layout() {
		super();
	}

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)  //根据底层数据库自动选择方式，需要底层数据库的设置
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return id;
    }

    @Column(name="type",  length=11, nullable=true)
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Column(name="ext",  length=11, nullable=true)
    public Integer getExt() {
        return ext;
    }

    public void setExt(Integer ext) {
        this.ext = ext;
    }

    @Column(name="top",  length=11, nullable=true)
    public Integer getTop() {
        return top;
    }

    public void setTop(Integer top) {
        this.top = top;
    }

    @Column(name="h",  length=11, nullable=true)
    public Integer getH() {
        return h;
    }

    public void setH(Integer h) {
        this.h = h;
    }

    @Column(name="w",  length=11, nullable=true)
    public Integer getW() {
        return w;
    }

    public void setW(Integer w) {
        this.w = w;
    }

    @Column(name="page",  length=11, nullable=true)
    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    @Column(name="x",  length=11, nullable=true)
    public Integer getX() {
        return x;
    }

    public void setX(Integer x) {
        this.x = x;
    }

    @Column(name="y",  length=11, nullable=true)
    public Integer getY() {
        return y;
    }

    public void setY(Integer y) {
        this.y = y;
    }

    @Column(name="mode",  length=11, nullable=true)
    public Integer getMode() {
        return mode;
    }

    public void setMode(Integer mode) {
        this.mode = mode;
    }


    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name="name",  length=40, nullable=true)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name="subject0",  length=40, nullable=true)
    public String getSubject0() {
        return subject0;
    }

    public void setSubject0(String subject0) {
        this.subject0 = subject0;
    }

    @Column(name="subject1",  length=40, nullable=true)
    public String getSubject1() {
        return subject1;
    }

    public void setSubject1(String subject1) {
        this.subject1 = subject1;
    }

    @Column(name="src",  length=40, nullable=true)
    public String getSrc() {
        return src;
    }

    public void setSrc(String src) {
        this.src = src;
    }

    @Column(name="package",  length=40, nullable=true)
    public String getPackagename() {
        return packagename;
    }

    public void setPackagename(String packagename) {
        this.packagename = packagename;
    }

    @Column(name="time",  length=20, nullable=true)
    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }
    @Column(name="size",  length=10, nullable=true)
    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    @Column(name="ver",  length=20, nullable=true)
    public Integer getVer() {
        return ver;
    }

    public void setVer(Integer ver) {
        this.ver = ver;
    }

    @Column(name="control",  length=20, nullable=true)
    public Integer getControl() {
        return control;
    }

    public void setControl(Integer control) {
        this.control = control;
    }

    @Column(name="device",  length=20, nullable=true)
    public Integer getDevice() {
        return device;
    }

    public void setDevice(Integer device) {
        this.device = device;
    }

}
